import { createApp } from "vue";
import App from "./App.vue";
// reset style sheet
import "@/styles/reset.scss";
// CSS common style sheet
import "@/styles/common.scss";
// iconfont css
import "@/assets/iconfont/iconfont.scss";
// font css
import "@/assets/fonts/font.scss";
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@/styles/element-dark.scss";
// custom element css
import "@/styles/element.scss";
// svg icons
// import "virtual:svg-icons-register";
// element plus
import ElementPlus from "element-plus";
// custom directives
import directives from "@/directives/index";
// vue Router
import router from "@/routers";
// pinia store
import pinia from "@/stores";
// errorHandler
import errorHandler from "@/utils/errorHandler";
// main.ts
import "virtual:uno.css";

import { MotionPlugin } from "@vueuse/motion";

const app = createApp(App);

app.config.errorHandler = errorHandler;


//加载elementUI图标组件
import * as EpIcons from '@element-plus/icons-vue'
Object.keys(EpIcons).forEach(key => {
  app.component(key, EpIcons[key as keyof typeof EpIcons]);
});
//加载IcoMoon Free图标组件
import * as ImIcons from 'vue-icons-plus/im'
Object.keys(ImIcons).forEach(key => {
  app.component(key, ImIcons[key as keyof typeof ImIcons]);
});

app.use(ElementPlus).use(directives).use(router).use(pinia).use(MotionPlugin).mount("#app");
